function out = GetLogisticRegression(X,Y,xpoints,LogYes,Plots)
if nargin <3
    LogYes = 1;
    Plots = 1;
    xpoints = [-3:.5:1.5];
end

% Create Logged X Vector
if LogYes
    idx = find(X==0);
    X(idx) = [];
    Y(idx) = [];
    X = log10(X);
end

% Create Model
model = fitglm(X,Y,'distribution','binomial');
[YPrediction, CI] = predict(model,X);

% Plot
if Plots
    figure
    plot(X,Y,'x',X,YPrediction,'o',X,CI(:,1),'c.',X,CI(:,2),'c.')
    plotSlice(model)
end

% Remove Uniquie
[C,IA,IC] = unique(X);

% Output Variable
out.X = xpoints;
% Need to remove unique
out.Y = interp1(X(IA),YPrediction(IA),xpoints)*100;
out.CIlow= interp1(X(IA),CI(IA,1),xpoints)*100;
out.CIhigh= interp1(X(IA),CI(IA,2),xpoints)*100;
end